import { Mongo } from 'meteor/mongo';
import { SimpleSchema } from 'meteor/aldeed:simple-schema';

import { Meteor } from 'meteor/meteor';

class SensorTriggersCollection extends Mongo.Collection {
    update(selector, modifier) {
        const result = super.update(selector, modifier);
        return result;
    }
    insert(trigger, callback) {
        const ourSensorTriggers = trigger;
        const result = super.insert(ourSensorTriggers, callback);
        return result;
    }
    remove(selector, callback) {
        const result = super.remove(selector, callback);
        return result;
    }
}

export const SensorTriggers = new SensorTriggersCollection('sensor_triggers');

SensorTriggers.deny({
    insert() { return true; },
    update() { return true; },
    remove() { return true; },
});
/*
*
* 打开门窗传感器
* 关闭门窗传感器
* 有人经过传感器
* 可燃气体报警器报警
* 可燃气体报警从报警恢复正常
* 烟雾报警器报警
* 烟雾报警器从报警恢复正常
* 水浸传感器报警
* 水浸传感器从报警恢复正常
* 温湿度传感器预警
* */
SensorTriggers.schema = new SimpleSchema({

    name:{
        label:"名称",
        type: String
    },
    type:{
        label:"操作类型",
        type: String
    },
    status: {
        label: "状态",
        type: String
    }

});
SensorTriggers.attachSchema(SensorTriggers.schema);
